<?php
header("Content-type:text/html;charset=utf8");
header("Access-Control-Allow-Origin:*");
    $name=$_POST["username"];
    $pass=$_POST["userpass"];

    $conn=mysqli_connect("localhost","root","root","my2208");
    if($conn){
        $sql="insert into students(username,userpass) value('$name','$pass')";

        $res=mysqli_query($conn,$sql);
    
        if($res){
            echo "1"; 
        }else{
            echo "0";
        }
    }else{
        echo "链接失败";
    }
?>